package com.lds.config.center.server.business.namespace.converter;

import com.lds.config.center.common.model.namespace.request.NamespaceBaseListPageRequest;
import com.lds.config.center.server.business.namespace.entity.Namespace;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class NamespaceBaseListPageRequestToEntityConverter implements Converter<NamespaceBaseListPageRequest, Namespace> {

    @Override
    public Namespace convert(NamespaceBaseListPageRequest source) {
        return Namespace.builder()
                .id(source.getId())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .name(source.getName())
                .format(source.getFormat())
                .appId(source.getAppId())
                .desc(source.getDesc())
                .build();
    }

}


